.class public Lcom/facebook/orca/activity/AuthenticatingActivityHelper;
.super Ljava/lang/Object;
.source "AuthenticatingActivityHelper.java"


# static fields
.field private static final l:Lcom/facebook/orca/prefs/PrefKey;


# instance fields
.field private final a:Ljava/lang/String;

.field private final b:Lcom/facebook/orca/auth/AuthenticationManager;

.field private final c:Lcom/facebook/orca/prefs/OrcaSharedPreferences;

.field private final d:Lcom/facebook/orca/config/OrcaConfig;

.field private final e:Lcom/facebook/orca/cache/DataCache;

.field private final f:Landroid/app/Activity;

.field private final g:Lcom/facebook/android/Facebook;

.field private final h:Lcom/facebook/orca/common/util/VersionStringComparator;

.field private final i:Z

.field private j:Ljava/lang/String;

.field private k:Landroid/content/Intent;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 49
    const-string v0, "messenger_phone_verification_android"

    invoke-static {v0}, Lcom/facebook/orca/prefs/PrefKeys;->d(Ljava/lang/String;)Lcom/facebook/orca/prefs/PrefKey;

    move-result-object v0

    sput-object v0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->l:Lcom/facebook/orca/prefs/PrefKey;

    return-void
.end method

.method public constructor <init>(Lcom/facebook/orca/auth/AuthenticationManager;Lcom/facebook/orca/prefs/OrcaSharedPreferences;Lcom/facebook/orca/config/OrcaConfig;Lcom/facebook/orca/cache/DataCache;Landroid/app/Activity;Lcom/facebook/android/Facebook;Lcom/facebook/orca/common/util/VersionStringComparator;Z)V
    .locals 1
    .parameter
    .end parameter
    .parameter
    .end parameter
    .parameter
    .end parameter
    .parameter
    .end parameter
    .parameter
    .end parameter
    .parameter
    .end parameter
    .parameter
    .end parameter
    .parameter
        .annotation runtime Lcom/facebook/orca/annotations/DisableSmsConfirmationFlow;
        .end annotation
    .end parameter
    .annotation runtime Lcom/google/inject/Inject;
    .end annotation

    .prologue
    .line 61
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 32
    const-string v0, "AuthenticatingActivityHelper"

    iput-object v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->a:Ljava/lang/String;

    .line 62
    iput-object p1, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->b:Lcom/facebook/orca/auth/AuthenticationManager;

    .line 63
    iput-object p2, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->c:Lcom/facebook/orca/prefs/OrcaSharedPreferences;

    .line 64
    iput-object p3, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->d:Lcom/facebook/orca/config/OrcaConfig;

    .line 65
    iput-object p4, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->e:Lcom/facebook/orca/cache/DataCache;

    .line 66
    iput-object p5, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->f:Landroid/app/Activity;

    .line 67
    iput-object p6, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->g:Lcom/facebook/android/Facebook;

    .line 68
    iput-object p7, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->h:Lcom/facebook/orca/common/util/VersionStringComparator;

    .line 69
    iput-boolean p8, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->i:Z

    .line 70
    return-void
.end method

.method private a(Landroid/content/Intent;)V
    .locals 2
    .parameter

    .prologue
    .line 102
    const-string v0, "return_uri"

    iget-object v1, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->j:Ljava/lang/String;

    invoke-virtual {p1, v0, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 103
    const-string v0, "return_intent"

    iget-object v1, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->k:Landroid/content/Intent;

    invoke-virtual {p1, v0, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 104
    return-void
.end method


# virtual methods
.method public a()V
    .locals 2

    .prologue
    .line 73
    iget-object v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->f:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    .line 74
    if-eqz v0, :cond_0

    .line 75
    const-string v1, "return_uri"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->j:Ljava/lang/String;

    .line 76
    const-string v1, "return_intent"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v0

    check-cast v0, Landroid/content/Intent;

    iput-object v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->k:Landroid/content/Intent;

    .line 78
    :cond_0
    return-void
.end method

.method public b()Z
    .locals 1

    .prologue
    .line 81
    const/4 v0, 0x0

    return v0
.end method

.method public c()Landroid/content/Intent;
    .locals 3

    .prologue
    .line 86
    invoke-virtual {p0}, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->b()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 87
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->f:Landroid/app/Activity;

    const-class v2, Lcom/facebook/orca/auth/StartScreenActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 91
    :goto_0
    invoke-direct {p0, v0}, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->a(Landroid/content/Intent;)V

    .line 92
    return-object v0

    .line 89
    :cond_0
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->f:Landroid/app/Activity;

    const-class v2, Lcom/facebook/orca/auth/LoginScreenActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    goto :goto_0
.end method

.method public d()Landroid/content/Intent;
    .locals 3

    .prologue
    .line 96
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->f:Landroid/app/Activity;

    const-class v2, Lcom/facebook/orca/auth/SilentLoginActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 97
    invoke-direct {p0, v0}, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->a(Landroid/content/Intent;)V

    .line 98
    return-object v0
.end method

.method public e()Z
    .locals 4

    .prologue
    const/4 v3, 0x0

    .line 107
    iget-object v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->e:Lcom/facebook/orca/cache/DataCache;

    invoke-virtual {v0}, Lcom/facebook/orca/cache/DataCache;->i()Lcom/facebook/orca/appconfig/AppConfig;

    move-result-object v0

    .line 108
    if-nez v0, :cond_0

    move v0, v3

    .line 115
    :goto_0
    return v0

    .line 112
    :cond_0
    const-string v1, "AuthenticatingActivityHelper"

    invoke-virtual {v0}, Lcom/facebook/orca/appconfig/AppConfig;->a()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/facebook/orca/debug/BLog;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 113
    iget-object v1, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->d:Lcom/facebook/orca/config/OrcaConfig;

    invoke-virtual {v1}, Lcom/facebook/orca/config/OrcaConfig;->a()Ljava/lang/String;

    move-result-object v1

    .line 114
    invoke-virtual {v0}, Lcom/facebook/orca/appconfig/AppConfig;->a()Ljava/lang/String;

    move-result-object v0

    .line 115
    iget-object v2, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->h:Lcom/facebook/orca/common/util/VersionStringComparator;

    invoke-virtual {v2, v0, v1}, Lcom/facebook/orca/common/util/VersionStringComparator;->a(Ljava/lang/String;Ljava/lang/String;)I

    move-result v0

    if-lez v0, :cond_1

    const/4 v0, 0x1

    goto :goto_0

    :cond_1
    move v0, v3

    goto :goto_0
.end method

.method public f()Z
    .locals 5

    .prologue
    const-wide/16 v3, 0x0

    const/4 v2, 0x0

    .line 123
    iget-boolean v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->i:Z

    if-eqz v0, :cond_0

    .line 124
    const-string v0, "AuthenticatingActivityHelper"

    const-string v1, "Confirmation disabled"

    invoke-static {v0, v1}, Lcom/facebook/orca/debug/BLog;->a(Ljava/lang/String;Ljava/lang/String;)V

    move v0, v2

    .line 142
    :goto_0
    return v0

    .line 128
    :cond_0
    iget-object v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->b:Lcom/facebook/orca/auth/AuthenticationManager;

    invoke-virtual {v0}, Lcom/facebook/orca/auth/AuthenticationManager;->f()Lcom/facebook/orca/users/User;

    move-result-object v0

    .line 129
    invoke-virtual {v0}, Lcom/facebook/orca/users/User;->n()Z

    move-result v0

    if-nez v0, :cond_1

    iget-object v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->c:Lcom/facebook/orca/prefs/OrcaSharedPreferences;

    sget-object v1, Lcom/facebook/orca/prefs/PrefKeys;->k:Lcom/facebook/orca/prefs/PrefKey;

    invoke-virtual {v0, v1, v3, v4}, Lcom/facebook/orca/prefs/OrcaSharedPreferences;->a(Lcom/facebook/orca/prefs/PrefKey;J)J

    move-result-wide v0

    cmp-long v0, v0, v3

    if-gtz v0, :cond_1

    iget-object v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->c:Lcom/facebook/orca/prefs/OrcaSharedPreferences;

    sget-object v1, Lcom/facebook/orca/prefs/PrefKeys;->l:Lcom/facebook/orca/prefs/PrefKey;

    invoke-virtual {v0, v1, v3, v4}, Lcom/facebook/orca/prefs/OrcaSharedPreferences;->a(Lcom/facebook/orca/prefs/PrefKey;J)J

    move-result-wide v0

    cmp-long v0, v0, v3

    if-lez v0, :cond_2

    .line 132
    :cond_1
    const-string v0, "AuthenticatingActivityHelper"

    const-string v1, "Confirmation not needed"

    invoke-static {v0, v1}, Lcom/facebook/orca/debug/BLog;->a(Ljava/lang/String;Ljava/lang/String;)V

    move v0, v2

    .line 133
    goto :goto_0

    .line 136
    :cond_2
    iget-object v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->c:Lcom/facebook/orca/prefs/OrcaSharedPreferences;

    sget-object v1, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->l:Lcom/facebook/orca/prefs/PrefKey;

    invoke-virtual {v0, v1, v2}, Lcom/facebook/orca/prefs/OrcaSharedPreferences;->a(Lcom/facebook/orca/prefs/PrefKey;Z)Z

    move-result v0

    if-nez v0, :cond_3

    .line 137
    const-string v0, "AuthenticatingActivityHelper"

    const-string v1, "GK is off"

    invoke-static {v0, v1}, Lcom/facebook/orca/debug/BLog;->a(Ljava/lang/String;Ljava/lang/String;)V

    move v0, v2

    .line 138
    goto :goto_0

    .line 141
    :cond_3
    const-string v0, "AuthenticatingActivityHelper"

    const-string v1, "Confirmation is needed"

    invoke-static {v0, v1}, Lcom/facebook/orca/debug/BLog;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 142
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public g()Landroid/content/Intent;
    .locals 3

    .prologue
    .line 153
    iget-object v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->j:Ljava/lang/String;

    if-eqz v0, :cond_0

    .line 154
    const-string v0, "AuthenticatingActivityHelper"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Going to "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->j:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/facebook/orca/debug/BLog;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 155
    new-instance v0, Landroid/content/Intent;

    const-string v1, "android.intent.action.VIEW"

    iget-object v2, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->j:Ljava/lang/String;

    invoke-static {v2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v2

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    .line 163
    :goto_0
    return-object v0

    .line 156
    :cond_0
    iget-object v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->k:Landroid/content/Intent;

    if-eqz v0, :cond_1

    .line 157
    const-string v0, "AuthenticatingActivityHelper"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Going to "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->k:Landroid/content/Intent;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/facebook/orca/debug/BLog;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 158
    iget-object v0, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->k:Landroid/content/Intent;

    invoke-virtual {v0}, Landroid/content/Intent;->clone()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Landroid/content/Intent;

    move-object v0, p0

    goto :goto_0

    .line 160
    :cond_1
    const-string v0, "AuthenticatingActivityHelper"

    const-string v1, "Going to threadlist."

    invoke-static {v0, v1}, Lcom/facebook/orca/debug/BLog;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 161
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/facebook/orca/activity/AuthenticatingActivityHelper;->f:Landroid/app/Activity;

    const-class v2, Lcom/facebook/orca/threadlist/ThreadListActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    goto :goto_0
.end method
